package com.github.butid.data.codec;

import com.thoughtworks.xstream.annotations.XStreamAliasType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.HashMap;
import java.util.Map;

/**
 * @author wangjing.dc@qq.com
 * @since 2020/8/4
 */
@Data
@Accessors(chain = true)
@XStreamAliasType("root")
public class CmdMessage {

    private Header header = new Header();

    private Map<String, Object> body = new HashMap<String, Object>();

    /**
     * 添加报文体
     * @param key
     * @param value
     * @return
     */
    public CmdMessage addBody(String key, Object value){
        this.body.put(key, value);
        return this;
    }
}
